package cn.com.util;

import android.content.Context;
import android.widget.Toast;

/**
 * 自定义 TOAST工具类,解决重复显示 增加用户体验
 * @author ChonZY
 *
 */
public class MyToast {
	
	private static Context context = null ;
	private static Toast toast = null ;
	
	public static Toast getToast(Context context , String hint){
		if(MyToast.context  == context){
			toast.cancel();
			toast.setText(hint);
		}
		else{
			MyToast.context = context ;
			toast = Toast.makeText(context, hint, Toast.LENGTH_SHORT);
		}
		
		return toast;
	}

}
